from toee import *
from utilities import *

def san_dialog( attachee, triggerer ):
	if (attachee.has_met(triggerer)):
		triggerer.begin_dialog( attachee, 10 )
	else:
		triggerer.begin_dialog( attachee, 1 )
	return SKIP_DEFAULT

def san_start_combat( attachee, triggerer ):
	if ( obj_percent_hp(attachee) < 75 and attachee.stat_level_get(stat_hp_current) >= 0):
		attachee.float_line(200,triggerer)	
		game.particles( 'sp-Fireball-Hit', attachee )
		loc = location_from_axis(427,406)
		attachee.runoff(loc)	
	return RUN_DEFAULT
	## THIS IS USED FOR BREAK FREE
	for obj in game.party[0].group_list():
		if (obj.distance_to(attachee) <= 3 and obj.stat_level_get(stat_hp_current) >= -9):
			return RUN_DEFAULT		
	while(attachee.item_find(8903) != OBJ_HANDLE_NULL):
		attachee.item_find(8903).destroy()
	if (attachee.d20_query(Q_Is_BreakFree_Possible)):
		create_item_in_inventory( 8903, attachee )
##		attachee.d20_send_signal(S_BreakFree)
	return RUN_DEFAULT

def make_saduj_talk( attachee, triggerer, line):
	npc = find_npc_near(attachee,14689)
	if (npc != OBJ_HANDLE_NULL):
		triggerer.begin_dialog(npc,line)
		npc.turn_towards(attachee)
		attachee.turn_towards(npc)
	return SKIP_DEFAULT